﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ZLDC.Common.Estate;

namespace ZLDC.Estate.TM
{
    public partial class SelectBuild : _PageBase
    {
        private int eid = 0;
        string nextUri = string.Empty;
        string type = string.Empty;
        string typename = string.Empty;
        int photocount = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            eid = _Request.GetInt("eid", 0);    // 楼盘基本信息ID(t_estate表)
            type = _Request.GetString("type", "");
            typename = _Request.GetString("typename", "");
            //photocount = _Request.GetInt("photocount", 0);    // 允许上传的图片量
            if (!IsPostBack)
            {

                int id = _Request.GetInt("id", 0);
                hEID.Value = eid.ToString();                

                lbEstateName.Text = ZLDC.Topo.BLL.Estate.EstateBLL.EstateNameById(eid);

                LoadBuild(eid, lbEstateName.Text);
            }
        }

        /// <summary>
        /// 加载某楼盘下的的有栋阁
        /// </summary>
        private void LoadBuild(int eid, string estateName)
        {
            ZLDC.Topo.BLL.Estate.BuildBLL.LoadBuild(sBuild, eid, estateName);           
        }

        protected void btnNext_Click(object sender, ImageClickEventArgs e)
        {
            Response.Write("<script>alert('" + sBuild.Value + "')</script>");
            Session["bid"] = sBuild.Value;
            Response.Redirect("~/swfupload/index.aspx?url=" + HttpUtility.UrlEncode("~/TM/SavePhoto.aspx?id=" + eid + "&bid=" + sBuild.Value + "&type=" + type + "&typename=" + typename) + "&id=" + eid + "&type=" + type + "&typename=" + typename);
        }

    }
}
